package com.hmkj.core.service.amount.impl;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.constant.PointNid;
import com.hmkj.core.mapper.amount.PointLogMapper;
import com.hmkj.core.po.user.PointLog;
import com.hmkj.core.service.amount.PointLogService;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 用户积分奖励记录表业务相关Service接口实现<br>
 *
 * @ClassName: PointLogServiceImpl
 * @author eproo
 * @date   2017-11-24 03:05:38
 */
@Service
@Scope("prototype")
@Transactional(rollbackFor = Exception.class)
public class PointLogServiceImpl implements PointLogService {

	@Resource
    private PointLogMapper pointLogMapper;

    @Override
    public GenericMapper<PointLog,Integer> _getMapper() {
        return pointLogMapper;
    }

    @Override
    public List<PointLog> findSignPointByTime(Integer userId) {
        Map<String, Object> param = new HashMap<>();
        param.put("userId",userId);
        param.put("nid", PointNid.T2.nid);
        param.put("createTime",new Date());
        return pointLogMapper.findSignPointByTime(param);
    }
}
